import { loanProductObject } from '@/static/constant';

export default {
  methods: {

    addCount (val1, val2) {
      return (val1 + val2).toFixed(2);
    },
    extendFormat(val) {
      return val != -1 ? val == 0 ? '否' : '是' : '';
    },
    productFormat(pno) {
      if (pno) {
        if (pno === '-1') return '';
        let arr = pno.split('_');
        return `${arr[1]}-${arr[3]}%`;
      }
      return '';
    }
  },
  filters: {
    extendFormatter (value) {
      switch (value) {
        case -1:
          return '';
          break;
        case 0:
          return '否';
        case 1:
          return '是';
        default:
          break;
      }
    },
    productFormatter(pno) {
      if (pno) {
        if (pno === '-1') return '';
        let arr = pno.split('_');
        return `${arr[1]}-${arr[3]}%`;
      }
      return '';
    }
  }
}
